package com.qanda.tools;

import android.content.Context;

import com.qanda.data.entities.Korisnik;

public class LocalDataManager {
	
	private Context context;
	
	public LocalDataManager(Context ctx)
	{
		context = ctx;
	}
	
	public boolean saveKorisnik(Korisnik k)
	{
		LocalDbAdapter adapter = new LocalDbAdapter(context);
		adapter.open();
		long result = adapter.insertKorisnik(k.getId(), k.getUname(), k.getPass(), k.getUid());
		adapter.close();
		return result>0;
	}
	
	public boolean clearKorisnik()
	{
		LocalDbAdapter adapter = new LocalDbAdapter(context);
		return adapter.deleteKorisnik(1);
	}
}
